package com.ys;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;





@Controller
public class MyControl2 {
	
	@Autowired
	private MyService myService;

	
	public MyControl2() {
		System.out.println("mc。。。。。。。。。。。。。。。。");
	}
	
	
	@RequestMapping(value="/m2",
			method={RequestMethod.POST,RequestMethod.GET})
	public String mm1(User user){
		System.out.println(user);
		return "ttt";
	}
	
	
	@RequestMapping(value="/m3",
			method={RequestMethod.GET})
	public String mm2(HttpServletRequest request){
		System.out.println("request="+request.getParameter("code"));
		return "ttt";
	}

	
	@RequestMapping(value="/mm3",
			method={RequestMethod.GET})
	public String mm3(){
		System.out.println(myService);
		myService.test();
		return null;
	}

	
	

	public void setMyService(MyService myService) {
		this.myService = myService;
	}
	
	
}
